package com.panshi.bean;

/*
 * 分页工具类
 * */

import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

import java.io.Serializable;

@Data
@AllArgsConstructor
@NoArgsConstructor
@ApiModel("分页实体类")
public class PageUtil<T> implements Serializable {

    @ApiModelProperty("业务Id")
    private int aid;

    @ApiModelProperty("类型Id")
    private int tid;

    @ApiModelProperty("0已回答 1未回答")
    private int answer;

    @ApiModelProperty("起始页")
    private int startIndex;

    @ApiModelProperty("分页大小")
    private int pageSize;

    @ApiModelProperty("总数")
    private int total;

    @ApiModelProperty("关键词")
    private String kw;

    @ApiModelProperty("首页根据类型判断获取数据")
    private int type;

    @ApiModelProperty("数据")
    private T data;//数据

    public int getStartIndexInfo() {
        return (startIndex - 1) * pageSize;
    }
}
